package com.myapp.struts.prepare;

//~--- JDK imports ------------------------------------------------------------
import com.myapp.struts.beans.JvBean;

import java.sql.*;

import java.util.*;

//class to get arraylist
public class JvPrepareAL {
    // instance variable declaration

    Vector vec = new Vector();

//  method to get arraylist
    public Vector prepareArrayList(ResultSet rs) {
        try {
            if (rs == null) {
            } // end of if
            else {
                while (rs.next()) {
                    JvBean jb = new JvBean();

                    jb.setJv_No(rs.getString(1));
                    jb.setJv_Date(rs.getString(2));
                    jb.setAccount_Head(rs.getString(3));
                    System.out.println("Ac Head=" + jb.getAccount_Head());
                    jb.setDebit_Amount(rs.getString(4));
                    jb.setCredit_Amount(rs.getString(5));
                    jb.setTotal_Amount(rs.getString(6));
                    jb.setAmount_type(rs.getString(7));
                    jb.setNarration(rs.getString(8));
                    jb.setCreatedBy(rs.getString(9));
                    jb.setCreatedDt(rs.getString(10));
                    jb.setJv_Status(rs.getString(11));
                    vec.add(jb);
                }                 // end of while
            }                     // end of else
        } // end of try
        catch (Exception e) {
            System.out.println("exception at JvPrepareAL" + e);
        }                         // end of catch

        return vec;
    }    // end of arraylist method
}    // end of class

